package name.huzhenbo.java.patterns.strategy;

import java.util.Comparator;

public class StringComparator {
    private StringComparator(){
    }

    public static StringComparator getInstance() {
        return InstanceHolder.INSTANCE;
    }

    public int compare(String s1, String s2, Comparator comparator) {
        return comparator.compare(s1, s2);
    }

    private static class InstanceHolder{
        static final StringComparator INSTANCE = new StringComparator();
    }
}
